home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3824 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  602 b 

  1. Path: news.mel.connect.com.au!news
  2. From: Igor <igrossma@ais.com.au>
  3. Newsgroups: comp.lang.c++
  4. Subject: operator news overload
  5. Date: 26 Jan 1996 09:10:37 GMT
  6. Organization: Connect.com.au P/L
  7. Message-ID: <4ea5qd$9fl@perki.connect.com.au>
  8. NNTP-Posting-Host: 203.12.86.16
  9.  
  10. Could any one tell me how  I can  overload  an operator new ,that it will work like that:
  11. main ()
  12. {
  13.  int *i=new int;
  14. circle *c= new circle;
  15. }
  16.  
  17. In case store is exhausted  it should print out:
  18. " Can't allocate new int"
  19. or 
  20. "Can't allocate new circle"
  21.  
  22. depend on type to be allocated.
  23.  
  24. Thanks a lot.
  25. Igor Grossman
  26. igrossma@ais.com.au
  27.  
  28.